package com.one.system.manager;

import com.one.common.core.constants.CacheConstants;
import com.one.common.redis.service.RedisService;
import com.one.system.domain.question.Question;
import com.one.system.mapper.question.QuestionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class QuestionCacheManager {

    @Autowired
    private RedisService redisService;


    public void addCache(Long questionId) {
        redisService.leftPushForList(getQuestionListKey(),questionId);
    }

    public void deleteCache(Long questionId) {
        redisService.removeForList(getQuestionListKey(),questionId);
    }

    private String getQuestionListKey() {
        return CacheConstants.QUESTION_LIST;
    }


}
